package com.itheima.controller;

import com.itheima.common.domain.AjaxResult;
import com.itheima.order.entity.OmsCompanyAddress;
import com.itheima.service.OmsCompanyAddressService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
//关于后端收货地址
@Slf4j
@RestController
@RequestMapping("/companyAddress")
public class OmsCompanyAddressController {

    @Autowired
    private OmsCompanyAddressService omsCompanyAddressService;

    /**获取所有收货地址
     *
     * @return
     */
    @GetMapping("/list")
    public AjaxResult list() {
        List<OmsCompanyAddress> list = omsCompanyAddressService.list();
        return AjaxResult.success(list);
    }

}
